//
//  LGMedicineRecordNameCell.m
//  XieHeHeartDisease
//
//  Created by 1234 on 2024/3/7.
//  服药统计图 - 药物名称Cell

#import "LGMedicineRecordNameCell.h"

@interface LGMedicineRecordNameCell()
/**   */
@property (nonatomic , strong)UILabel *contentLabel;

@end

@implementation LGMedicineRecordNameCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubview:self.contentLabel];
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.contentView);
            make.centerY.equalTo(self.contentView);
            make.height.equalTo(@(viewPix(30)));
        }];
    }
    return self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    self.contentLabel.text = content;
}

-(void)setIsCurrent:(BOOL)isCurrent{
    _isCurrent = isCurrent;
    NSString *textColor = (isCurrent == NO)?@"#909399":kThemeColor;
    NSString *backColor = (isCurrent == NO)?@"#EFEFEF":@"#F0F3FD";
    self.contentLabel.textColor = [UIColor colorWithString:textColor];
    self.contentLabel.backgroundColor = [UIColor colorWithString:backColor];
}


-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"" colorString:@"#909399" textFont:LGFont(14) textAlignment:NSTextAlignmentCenter lines:1];
        _contentLabel.backgroundColor = [UIColor colorWithString:@"#EFEFEF"];
        _contentLabel.cornerRidus = viewPix(15);
    }
    return _contentLabel;
}

@end
